package com.java.gamePackeg.event;


import com.java.gamePackeg.Player;
import com.java.gamePackeg.Product;
import com.java.gamePackeg.XianLiveMain;

import javax.swing.*;
import java.util.List;

/**
 * @author shkstart
 * @create 2021-01-20 16:51
 */
public class GymShoesEvent implements Event {
    Product product = XianLiveMain.getProList().get(9);
    private static final float PRICE = 1.5f;

    @Override
    public void event(Player player, List<Product> marketProList) {
        if (marketProList.contains(product)) {
            JOptionPane.showMessageDialog(null, "罗永浩直播带货，兴起球鞋热，球鞋涨价啦");

            product.setNowPrice((int) Math.round(product.getMaxPrice() * PRICE));
        } else {
            return;
        }
    }


}
